package com.lakeworks.common.utils.tool;

public class AccessKeyUtil {
    private static final String CHARS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/";
    private static final Integer LENGTH = 32;

    private static String generateAk() {
        String ak = "";
        for (int i = 0; i < 12; i++) {
            int rand = (int) (Math.random() * CHARS.length());
            ak += CHARS.charAt(rand);
        }
        return ak;
    }

    private static String generateSk() {
        String sk = "";
        for (int i = 0; i < LENGTH; i++) {
            int rand = (int) (Math.random() * CHARS.length());
            sk += CHARS.charAt(rand);
        }
        return sk;
    }
}
